package com.qdxwx.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Qdx NetSchool Platform
 * @author ZhiYong
 * @updateTime 2022/5/25
 * @description
 */
@Component
@ConfigurationProperties(prefix = "qdxwx")
public class ProjectConfig {
    /**
     * 项目名称
     */
    public static String name;
    /**
     * 版本
     */
    public static String version;
    /**
     * 根域名
     */
    public static String rootDomain;
    /**
     * 开启Ip地址
     */
    public static boolean addressEnabled;

    @Value("${qdxwx.name}")
    public void setName(String name) {
        ProjectConfig.name = name;
    }

    public static String getName() {
        return name;
    }

    @Value("${qdxwx.version}")
    public void setVersion(String version) {
        ProjectConfig.version = version;
    }

    public static String getVersion() {
        return version;
    }

    @Value("${qdxwx.rootDomain}")
    public void setRootDomain(String rootDomain) {
        ProjectConfig.rootDomain = rootDomain;
    }

    public static String getRootDomain() {
        return rootDomain;
    }

    @Value("${qdxwx.addressEnabled}")
    public void setAddressEnabled(boolean addressEnabled) {
        ProjectConfig.addressEnabled = addressEnabled;
    }

    public static boolean isAddressEnabled() {
        return addressEnabled;
    }
}
